<template>
	<view class="cint" @click="switchClick">
		<view class="icon-switch" :class="{'selected' : selected}">
			<image class="icon" :src="icon" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		name:"icon-switch",
		data() {
			return {
				
			};
		},
		props: {
			icon: {
				type: String,
				default: ''
			},
			selected: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			switchClick() {
				this.$emit('click')
			}
		}
	}
</script>

<style scoped>
	
	.icon-switch {
		margin: 3px 0 3px 0;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 4px;
		border: #73738f 1px solid;
		background-color: #272730;
		width: 27px;
		height: 27px;
	}
	
	.selected {
		background-color: #ff2440;
		border: #c9c9f9 1px solid;
	}
	
	.cint:hover {
		cursor: pointer;
		opacity: 0.9;
	}
	
	.cint:active {
		opacity: 0.6;
	}
	
	.icon {
		width: 70%;
		height: 70%;
	}
	
</style>